home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17605 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.0 KB  |  33 lines

  1. Path: news.th-darmstadt.de!news
  2. From: enno@inferenzsysteme.informatik.th-darmstadt.de (Enno Sandner)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Circular Usage (forward declaration?)
  5. Date: 16 Apr 1996 20:38:15 +0200
  6. Organization: Fachbereich Informatik, TH Darmstadt
  7. Sender: enno@kitz.inferenzsysteme.informatik.th-darmstadt.de
  8. Message-ID: <ltu3ykovzc.fsf@kitz.inferenzsysteme.informatik.th-darmstadt.de>
  9. References: <MRW.96Apr16184800@tobago.siemens.ch>
  10. NNTP-Posting-Host: kitz.intellektik.informatik.th-darmstadt.de
  11. In-reply-to: mrw@tobago.siemens.ch's message of 16 Apr 1996 16:48:00 GMT
  12. X-Newsreader: Gnus v5.1
  13.  
  14. In article <MRW.96Apr16184800@tobago.siemens.ch> mrw@tobago.siemens.ch (Waeckerlin Marc) writes:
  15.  
  16.    How do you realize this in C++:
  17.    (the whole problem is much more complex, but it can be reduced to that)
  18.  
  19.    class A
  20.    {
  21.        B x;
  22.    };
  23.  
  24.    class B
  25.    {
  26.        A x;
  27.    };
  28.  
  29. There's no way -- use pointers or references instead, i.e. dynamicly
  30. allocate the appropriate instance of class 'A' or class 'B'.
  31.  
  32.     Enno
  33.